#ifndef _ENGINE_SCENE_HPP
#define _ENGINE_SCENE_HPP

#include "../common.hpp"

namespace yep
{
    class Game;     //Foward declarations

    /**
     * @brief Represents a scene on the game @b [abstract].
     *
     * A represents stages, levels, menus or whatever logical unit on a game.
     **/
    class Scene
    {
    public:
        /**
         * @brief Destructor.
         **/
        virtual ~Scene(){}

        /**
         * @brief Called when this scene became the game's current scene.
         *
         * If game.running() is false, this is the first game's scene. It is
         *  useful to do additional initializing or integrity check.
         *
         * @param game A reference to the game class. Pepharps it is singleton,
         *  it seems a good practice remember it here.
         **/
        virtual void setup(Game &game) = 0;

        /**
         * @brief Called when this scene is no more the game's current scene.
         *
         * If game.running() is false, this is the last game's scene. It is
         *  useful to do additional memory cleaning and saving.
         *
         * @param game A reference to the game class. Pepharps it is singleton,
         *  it seems a good practice remember it here.
         **/
        virtual void cleanup(Game &game) = 0;

        /**
         * @brief Called once at every frame.
         *
         * Logic operations should be placed here.
         *
         * @param game A reference to the game class. Pepharps it is singleton,
         *  it seems a good practice remember it here.
         **/
        virtual void logic(Game &game) = 0;

        /**
         * @brief Called everytime the screen needs to be redrawn.
         *
         * Draw operations should be placed here. That kind of operations
         *  shouldn't change the game or scene state in a anyways, because
         *  the frequency is not guaranteed. The only guarantee offered is that when
         *  draw() is called, its call is just after update()'s call.
         *
         * The frequency is idealisticly the same of update(), because any state
         *  change caused on update should be saw by the user imediatelly, but the
         *  game is able to skip frames due peformance issues. Future versions
         *  can also implements a independent frame rate for drawing or frame
         *  smoothing.
         **/
        virtual void draw(Game &game) = 0;
    };

}

#endif // _ENGINE_SCENE_HPP

